Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.3.28
|
Leadtools.Dicom.Common.Extensions Namespace > DicomExtensions Class > GetNewViewPerspective Method : GetNewViewPerspective(RasterViewPerspective,Double[],PlaneOrientation) Method |
public static RasterViewPerspective GetNewViewPerspective( RasterViewPerspective viewPerspectiveOriginal, double[] imageOrientationVectors, PlaneOrientation po )
'Declaration
Public Overloads Shared Function GetNewViewPerspective( _ ByVal viewPerspectiveOriginal As RasterViewPerspective, _ ByVal imageOrientationVectors() As Double, _ ByVal po As PlaneOrientation _ ) As RasterViewPerspective
'Usage
Dim viewPerspectiveOriginal As RasterViewPerspective Dim imageOrientationVectors() As Double Dim po As PlaneOrientation Dim value As RasterViewPerspective value = DicomExtensions.GetNewViewPerspective(viewPerspectiveOriginal, imageOrientationVectors, po)
public: static RasterViewPerspective GetNewViewPerspective( RasterViewPerspective viewPerspectiveOriginal, array<double>^ imageOrientationVectors, PlaneOrientation^ po )
This example does the following:
Imports Leadtools.Dicom Imports Leadtools.Dicom.Common Imports Leadtools.Dicom.Common.Extensions Imports Leadtools.Dicom.Common.Linq Imports Leadtools.Dicom.Common.Linq.BasicDirectory Imports Leadtools Imports Leadtools.Dicom.Common.DataTypes <TestMethod()> _ Public Sub GetNewViewPerspectiveExample() ' Create a new coronal PlaneOrientation that corresponds to a horizontal flip Dim poCoronal As PlaneOrientation = New PlaneOrientation() poCoronal.Name = "Coronal or Frontal" ' This corresponds to a horizontal flip poCoronal.Top = OrientationAxis.Inferior poCoronal.Right = OrientationAxis.Right ' This condition is ignored Dim condition As TagValueOrientationCondition = New TagValueOrientationCondition(DicomTag.ImageOrientationPatient, Nothing) poCoronal.Condition = condition ' This specifies a row and column orientation vector that corresponds to a coronal slice ' Row: (1,0,0) ' Col: (0,0,-1) Dim imageOrientationVectors As Double() = New Double(5) {1, 0, 0, 0, 0, -1} ' Find the new view perspective Dim newViewPerspective As RasterViewPerspective = DicomExtensions.GetNewViewPerspective(RasterViewPerspective.TopLeft, imageOrientationVectors, poCoronal) ' New view perspective should be BottomLeft MessageBox.Show("newViewPerspective should be BottomLeft" & Constants.vbLf & "Actual newViewPerspective is " & newViewPerspective.ToString()) End Sub
using Leadtools.Dicom; using Leadtools.Dicom.Common; using Leadtools.Dicom.Common.Extensions; using Leadtools; using Leadtools.Dicom.Common.Linq.BasicDirectory; using Leadtools.Dicom.Common.DataTypes; [TestMethod] public void GetNewViewPerspectiveExample() { // Create a new coronal PlaneOrientation that corresponds to a horizontal flip PlaneOrientation poCoronal = new PlaneOrientation(); poCoronal.Name = "Coronal or Frontal"; // This corresponds to a horizontal flip poCoronal.Top = OrientationAxis.Inferior; poCoronal.Right = OrientationAxis.Right; // This condition is ignored TagValueOrientationCondition condition = new TagValueOrientationCondition(DicomTag.ImageOrientationPatient, null); poCoronal.Condition = condition; // This specifies a row and column orientation vector that correspond to a coronal slice // Row: (1,0,0) // Col: (0,0,-1) double[] imageOrientationVectors = new double[6] { 1, 0, 0, 0, 0, -1 }; // Find the new view perspective RasterViewPerspective newViewPerspective = DicomExtensions.GetNewViewPerspective(RasterViewPerspective.TopLeft, imageOrientationVectors, poCoronal); // New view perspective should be BottomLeft MessageBox.Show("newViewPerspective should be BottomLeft\nActual newViewPerspective is " + newViewPerspective.ToString()); }